package com.lms.desiginmode.factory;

import com.lms.desiginmode.factory.model.AbstractFactory;
import com.lms.desiginmode.factory.model.FactoryProducer;
import com.lms.desiginmode.factory.model.color.Color;
import com.lms.desiginmode.factory.model.shape.Shape;
import com.lms.desiginmode.factory.model.shape.ShapeFactory;

/**
 * @Author: 李孟帅
 * @CreateTime: 2020-12-10 11:00
 * @Description:
 *
 */
public class Test {
    public static void main(String[] args) {
        ShapeFactory shapeFactory = new ShapeFactory();
        Shape circle = shapeFactory.getShape("CIRCLE");
        Shape square = shapeFactory.getShape("SQUARE");
        Shape rectangle = shapeFactory.getShape("RECTANGLE");
        circle.draw();
        square.draw();
        rectangle.draw();

        AbstractFactory color = FactoryProducer.getFactory("COLOR");
        Color red = color.getColor("RED");
        red.fill();

    }


}
